package liuyuyang.controller;

import liuyuyang.domain.City;
import liuyuyang.pojo.Result;
import liuyuyang.service.CityService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/city")
public class CityController {
    @Resource
    private CityService cityService;

    @GetMapping
    public Result<List<City>> list() {
        return Result.success(cityService.list());
    }
}
